﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BackGoods_detail.aspx.cs"
    Inherits="Hospital_BackGoods_detail" %>

<%@ Register Src="../System/DbPageFlip.ascx" TagName="DbPageFlip" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>退货单详情</title>
    <link href="../styles/css.css" rel="stylesheet" type="text/css">

    <script language="vbscript" src="../Common/yz.vbs"></script>
  <script language="vbscript">
    	Function CheckForm1()
		Dim bolSubmit
		bolSubmit = True
		Dim txtInput
		dim i
		 
		Set txtInput = document.all("tabData1").all.tags("Input")

		msgbox "“" 
	    For i = 0 To txtInput.length - 1

		    If IsNull(txtInput(i).getAttribute("NumericOnly")) = False Then
			    If Len(txtInput(i).value) > 0 Then
				    If (IsNumeric(txtInput(i).value) = False or InStr(txtInput(i).value,"&") <>0 or InStr(txtInput(i).value,"d")<>0 or InStr(txtInput(i).value,"e") <>0) Then
					    msgbox "“" & txtInput(i).getAttribute("NumericOnly") & "”必须输入数字！",16,"修改档案"
					    txtInput(i).select()
					    txtInput(i).focus()
					    bolSubmit = False
					    CheckForm1 = False
					    Exit For
				    End If
			    End If
		    End If
		    If IsNull(txtInput(i).getAttribute("NotNull")) = False Then
			    If Len(Trim(txtInput(i).value)) = 0 Then
				    msgbox "“" & txtInput(i).getAttribute("NotNull") & "”必须输入！",16,"警告"
				    txtInput(i).select()
				    txtInput(i).focus()
				    bolSubmit = False
				    CheckForm1 = False
				    Exit For
			    End If
		    End If
		    If IsNull(txtInput(i).getAttribute("DateTimeOnly")) = False Then
			    If Len(txtInput(i).value) > 0 Then
				    If IsDate(txtInput(i).value) = False Then
					    msgbox "“" & txtInput(i).getAttribute("DateTimeOnly") & "”必须输入日期！",16,"修改档案"
					    txtInput(i).select()
					    txtInput(i).focus()
					    bolSubmit = False
					    CheckForm1 = False
					    Exit For
				    End If
			    End If
		    End If

		    If IsNull(txtInput(i).getAttribute("InvertedComma")) = False Then
			    If Len(txtInput(i).value) > 0 Then
				    If InStr (txtInput(i).value,"'") >0Then
					    msgbox "“" & txtInput(i).getAttribute("InvertedComma") & "”含有非法字符 ' 请重新输入！",16,"修改档案"
					    txtInput(i).select()
					    txtInput(i).focus()
					    bolSubmit = False
					    CheckForm1 = False
					    Exit For
				    End If
			    End If
		    End If
	    Next
		
	End Function
    </script>
     
     <script  language="javascript" type="text/javascript">
         function checkValue() {
             isCheck = true;
             checknum = 0;
             /*objinput=document.getElementsByTagName("Input");
             if(typeof(objinput)!="undefined")
             {
             for(i=0;i<objinput.length;i++)
             {
             objtext=objinput.item(i);
             objtext_name=objtext.attributes;
             if(objtext_name.getNamedItem("name").value.indexOf("batchnum")!=-1)
             {
             alert(objtext_name.getNamedItem("name").value);
             }
             }
             }*/

             objChk = document.getElementsByName("chk");
             if (typeof (objChk.length) != "undefined") {

                 for (i = 0; i < objChk.length; i++) {

                     if (objChk[i].checked) {
                         checknum++;
                         objChk_value = objChk[i].value;
                         objBatchNum_value = document.getElementById("batchnum" + objChk_value).value;
                         objvalidityDate_value = document.getElementById("validityDate" + objChk_value).value;
                         objBackBecause_value = document.getElementById("BackBecause" + objChk_value).value;
                         if (objBatchNum_value == "" || objvalidityDate_value == "" || objBackBecause_value == "") {
                             isCheck = false;
                             alert("药品批号,药品有效期,退货原因不能为空!");
                             break;
                         }

                     }
                 }
             } else {
                 if (objChk.checked) {
                     objChk_value = objChk.value;
                     objBatchNum_value = document.getElementById("batchnum" + objChk_value).value;
                     objvalidityDate_value = document.getElementById("validityDate" + objChk_value).value;
                     objBackBecause_value = document.getElementById("BackBecause" + objChk_value).value;

                     if (objBatchNum_value == "" || objvalidityDate_value == "" || objBackBecause_value == "") {
                         isCheck = false;
                         alert("药品批号,药品有效期,退货原因不能为空!");
                     }
                     checknum++;
                 }
             }

             if (checknum == 0) {
                 isCheck = false;
                 alert("请选择需要退货的药品!");
             }
             return isCheck;
         }
    </script>

</head>
<body>
    <form id="form1" runat="server" defaultbutton="found">
        <div>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td style="width: 4px">
                        <img src="../images/intro_left.gif" width="4" height="34"></td>
                    <td class="intro_wordbg">
                        退货单详情</td>
                    <td background="../images/intro_bg.gif">
                        <img src="../images/intro_right.jpg" width="118" height="34"></td>
                </tr>
            </table>

            <script language="javascript" src="../common/javascript/calendar.js" type="text/javascript"></script>

            <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table_table2">
                <tr>
                    <td class="table_td3" style="width: 143px; height: 28px;">
                        退货医院</td>
                    <td class="table_td2" style="height: 28px; width: 199px;">
                        <span style="color: #ff6666">
                            <asp:Label ID="LabHospital" runat="server" Text="Label" Width="163px"></asp:Label></span></td>
                    <td class="table_td3">
                        退货单名称</td>
                    <td class="table_td2" style="height: 28px; width: 230px;">
                        <span style="color: #ff6666">
                            <asp:Label ID="txtPlanName" runat="server" Text="Label" Width="163px"></asp:Label></span></td>
                </tr>
                <tr>
                    <td class="table_td3" style="width: 143px">
                        退货时间</td>
                    <td class="table_td2" colspan="3" style="height: 24px">
                        <asp:Label ID="txtStartTime" runat="server" Text="Label" Width="163px"></asp:Label>&nbsp;</td>
                </tr>
                <tr>
                    <td class="table_td3" style="height: 24px; width: 143px;">
                        退货单状态：
                    </td>
                    <td class="table_td2" colspan="3" style="height: 24px; width: 429">
                        <asp:RadioButtonList ID="rdoBuyStatus" runat="server" readonly RepeatDirection="Horizontal">
                            <asp:ListItem Text=" 未退货" Value="0" Enabled="false"></asp:ListItem>
                            <asp:ListItem Text="已选退货药品未提交" Value="1" Enabled="false"></asp:ListItem>
                            <asp:ListItem Text="已提交" Value="2" Enabled="false"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td class="table_td3" style="width: 143px; height: 12px;">
                    
                        备注</td>
                    <td class="table_td2" colspan="3" style="height: 12px">
                        <asp:Label ID="txtRemarks" runat="server" Text="Label" Height="40px" TextMode="MultiLine"
                            Width="534px">
                        </asp:Label></td>
                </tr>
                <tr align="center">
                    <td class="table_td2" colspan='4' align="center">
                        &nbsp;<asp:Label ID="labSubmit" runat="server" Text="Label"></asp:Label>
                       </td>
                </tr>
            </table>
            <p align="center">
                <font size='3' style="text-transform: none; color: blue; background-color: white">退货药品清单</font></p>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                       <table width="98%" id="tabData1" border="1"  cellpadding="0" cellspacing="0">
                <tr>
                    <td  align="right" style="height: 25px; width: 140px;">
                        通用名：</td>
                    <td style="width: 296px; height: 25px">
                        <asp:TextBox ID="txtProductName" runat="server" InvertedComma="通用名" Width="250px"></asp:TextBox>
                    </td>
                    <td align="right" style="height: 25px; width: 140px;">
                        药品流水号：
                    </td>
                    <td>
                        <asp:TextBox ID="txtGoodsId" runat="server" InvertedComma="流水号" NumericOnly="流水号"
                            Width="250px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="right" style="height: 25px; width: 148px;">
                        生产企业：</td>
                    <td style="height: 25px">
                        <asp:TextBox ID="textCompanyName_SC" runat="server" InvertedComma="生产企业" Width="250px"></asp:TextBox></td>
                    <td align="right" style="height: 26px; width: 140px;">
                        生产企业编码：&nbsp;</td>
                    <td style="width: 296px; height: 26px" align="left">
                        <asp:TextBox ID="Textuscoder_sc" runat="server" InvertedComma="生产企业编码" Width="250px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="right" style="height: 26px; width: 148px;">
                        配送企业：</td>
                    <td align="left" style="height: 26px">
                        <asp:TextBox ID="TextCompanyName_PS" runat="server" InvertedComma="配送企业" Width="250px"></asp:TextBox></td>
                    <td align="right" style="width: 140px; height: 26px">
                        配送企业编码：</td>
                    <td style="width: 296px; height: 26px">
                        <asp:TextBox ID="Textuscoder_ps" runat="server" InvertedComma="配送企业编码" Width="250px"></asp:TextBox></td>
                </tr>
                <tr>
                <td align="right" style="height: 25px; width: 140px;">
                    退货量：</td>
                        <td>
                        <asp:TextBox ID="txtGoodsNum" runat="server" InvertedComma="采购数量" NumericOnly="采购数量"
                            Width="250px"></asp:TextBox>
                            
                    </td>
                            <td style="width: 296px; height: 26px"  align="center">
                                &nbsp;
                        <asp:Button ID="found" runat="server"  OnClientClick="javascript:return CheckForm1();" class="button_bg6" Text="查　询" Width="71px" /></td>
                    <td style="height: 24px;" align="center">
                        <input id="Button1" type="button" value="关 闭" class="button_bg6" style="width: 50px"  onclick="javascript:self.close();" />
                        <asp:Button ID="Button2" runat="server" Text="打印" Width="70px" CssClass="button_bg6" OnClick="Button2_Click"/></td>
                </tr>
            </table>
                    </td>
                </tr>
            </table>
            <div align="right">
            <table>
                <tr>
                    <td>
                        <asp:Label ID="labLink" runat="server" Text="Label" ForeColor="White"></asp:Label>
                       </td>
                    <td>
                        <asp:Label ID="labDel" runat="server" Text="Label"></asp:Label>
                        
                        </td>
                    <td>
                        <asp:Label ID="labSave" runat="server" Text="Label"></asp:Label>
                    
                        </td>
                    <td>
                        <uc1:DbPageFlip ID="DbPageFlip1" class="btn" runat="server" />
                    </td>
                </tr>
            </table></div>
            <asp:Label ID="Lablist" runat="server" Text="Label"></asp:Label>
            <asp:GridView ID="GridView1" runat="server" Visible="false">
            </asp:GridView>
            <br />
        </div>
    </form>
</body>
</html>
